﻿<UserControl x:Class="TreeViewSample.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:TreeView;assembly=TreeView"
    Width="640" Height="600">
    
    <Grid x:Name="LayoutRoot" Background="Gray" Width="640" Height="600">
        <Grid.RowDefinitions>
            <RowDefinition Height="400"/>
            <RowDefinition Height="30*"/>
        </Grid.RowDefinitions>
        <local:TreeView x:Name="coursesTree" EnableCheckboxes="False" EnableDragAndDrop="True" Width="300" Height="400" 
                        Drop="Tree_Drop" 
                        TreeViewNodeClick="Tree_NodeClick"
                        TreeViewNodeDoubleClick="coursesTree_TreeViewNodeDoubleClick"
                        SelectionChanged="coursesTree_SelectionChanged"
                        MultiSelect="True"
                        Grid.Row="0" Margin="5" 
                        >
             <local:TreeView.TreeViewNodes>
                <local:TreeViewNode ID="myCourses" Text="Courses" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png" EnableCheckboxes="True">
                    <local:TreeViewNode.TreeViewNodes>
                        <local:TreeViewNode ID="myCourses_java" Text="Java" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png">
                            <local:TreeViewNode.TreeViewNodes>
                                <local:TreeViewNode ID="myCourses_java_begining" Text="Beginning Java" Icon="images/Document-16x16.png" />
                                <local:TreeViewNode ID="myCourses_advjava" Text="Advanced Java" Icon="images/Document-16x16.png"/>
                            </local:TreeViewNode.TreeViewNodes>
                        </local:TreeViewNode>
                        <local:TreeViewNode ID="myCourses_NET" Text=".NET" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png">
                            <local:TreeViewNode.TreeViewNodes>
                                <local:TreeViewNode ID="myCourses_NET_CS20" Text="CSharp" Icon="images/Document-16x16.png" />
                                <local:TreeViewNode ID="myCourses_NET_ADVCS20" Text="Advanced CSharp" Icon="images/Document-16x16.png" />
                                <local:TreeViewNode ID="myCourses_NET_ADO" Text="ADO" Icon="images/Document-16x16.png"/>
                                <local:TreeViewNode ID="myCourses_NET_35Related" Text=".NET 3.5 Related" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png" >
                                    <local:TreeViewNode.TreeViewNodes>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_WPF" Text="WPF" Icon="images/Document-16x16.png"/>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_Silverlight" Text="Silverlight 2" Icon="images/Document-16x16.png" />
                                        <local:TreeViewNode ID="myCourses_NET_35Related_WCF" Text="WCF" Icon="images/Document-16x16.png"/>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_WF" Text="WF" Icon="images/Document-16x16.png"/>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_LINQ" Text="LINQ" Icon="images/Document-16x16.png"/>
                                    </local:TreeViewNode.TreeViewNodes>
                                </local:TreeViewNode>
                            </local:TreeViewNode.TreeViewNodes>
                        </local:TreeViewNode>
                    </local:TreeViewNode.TreeViewNodes>
                </local:TreeViewNode>
                <local:TreeViewNode ID="myCourses" Text="Courses" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png">
                    <local:TreeViewNode.TreeViewNodes>
                        <local:TreeViewNode ID="myCourses_java" Text="Java" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png">
                            <local:TreeViewNode.TreeViewNodes>
                                <local:TreeViewNode ID="myCourses_java_begining" Text="Beginning Java" Icon="images/Document-16x16.png" />
                                <local:TreeViewNode ID="myCourses_advjava" Text="Advanced Java" Icon="images/Document-16x16.png"/>
                            </local:TreeViewNode.TreeViewNodes>
                        </local:TreeViewNode>
                        <local:TreeViewNode ID="myCourses_NET" Text=".NET" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png">
                            <local:TreeViewNode.TreeViewNodes>
                                <local:TreeViewNode ID="myCourses_NET_CS20" Text="CSharp" Icon="images/Document-16x16.png" />
                                <local:TreeViewNode ID="myCourses_NET_ADVCS20" Text="Advanced CSharp" Icon="images/Document-16x16.png" />
                                <local:TreeViewNode ID="myCourses_NET_ADO" Text="ADO" Icon="images/Document-16x16.png"/>
                                <local:TreeViewNode ID="myCourses_NET_35Related" Text=".NET 3.5 Related" Icon="images/Folder-Closed-16x16.png" IconExpanded="images/Folder-Open-16x16.png" >
                                    <local:TreeViewNode.TreeViewNodes>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_WPF" Text="WPF" Icon="images/Document-16x16.png"/>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_Silverlight" Text="Silverlight 2" Icon="images/Document-16x16.png" />
                                        <local:TreeViewNode ID="myCourses_NET_35Related_WCF" Text="WCF" Icon="images/Document-16x16.png"/>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_WF" Text="WF" Icon="images/Document-16x16.png"/>
                                        <local:TreeViewNode ID="myCourses_NET_35Related_LINQ" Text="LINQ" Icon="images/Document-16x16.png"/>
                                    </local:TreeViewNode.TreeViewNodes>
                                </local:TreeViewNode>
                            </local:TreeViewNode.TreeViewNodes>
                        </local:TreeViewNode>
                    </local:TreeViewNode.TreeViewNodes>
                </local:TreeViewNode>
            </local:TreeView.TreeViewNodes>
        </local:TreeView>
        <StackPanel Grid.Row="1">
            <TextBlock x:Name="txtDoubleClicks" Width="640" Text="DoubleClics: 0"></TextBlock>
            <TextBlock x:Name="txtSelectedItemsCount" Width="640" Text="Selected Items Count: 0"></TextBlock>
        </StackPanel>
    </Grid>
</UserControl>
